package com.zw.library.utils;

import android.content.Context;
import android.location.LocationManager;

import java.util.List;

/**
 * @Description: ${todo}
 * @ProjectName: LiWuShuo
 * @Package: com.zw.library.utils
 * @ClassName: Utils
 * @author: zhangwei
 * @date: 2015-09-18 17:00
 * @version: v1.0
 */
public class Utils {

    /**
     * 判断gps是否打开
     * @param context
     * @return
     */
    public static boolean isGpsEnabled(Context context) {
        LocationManager locationManager = ((LocationManager) context.getSystemService(Context.LOCATION_SERVICE));
        List<String> accessibleProviders = locationManager.getProviders(true);
        return accessibleProviders != null && accessibleProviders.size() > 0;
    }
}
